<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>条件渲染 - 出错输出</title>
    <script src="https://unpkg.com/vue@next"></script>
  </head>
  <body>
    <div style="text-align: center;" id="Application">
      <h1 v-if="show">标题</h1>
      <h1>Hello</h1>
      <p v-else>如果不显示标题就显示段落</p>
      <br/>
      <button @click="switchFlag">切换</button>
    </div>
  </body>

  <script>
    const App= {
      data(){
        return {
          show:true
        }
      },
      methods: {
        switchFlag(){
          this.show = !this.show
        }
      }
    }
    Vue.createApp(App).mount("#Application")
  </script>

</html>